package com.pulse.base.mapper;


import com.pulse.base.domain.JobDispatch;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @ClassName JobDispatchMapper
 * @Description
 * @Author 陆帅
 * @Date 2024/8/14 10:36
 */
public interface JobDispatchMapper {
    /**
     * 插入
     * @param jobDispatch
     * @return
     */
    int insertJobDispatch(JobDispatch jobDispatch);

    /**
     * 根据设备编号和通道查询调度任务
     * @param deviceNo
     * @param channel
     * @return
     */
    JobDispatch selectByDeviceNoAndChannel(@Param("deviceNo") String deviceNo, @Param("channel") Long channel);

    /**
     * 删除任务
     * @param id
     */
    void deleteById(Long id);

    /**
     * 根据设备编号查询
     * @param deviceNo
     * @return
     */
    List<JobDispatch> selectByDeviceNo(String deviceNo);

    /**
     * 根据设备编号删除
     * @param deviceNo
     * @return
     */
    int deleteByDeviceNo(String deviceNo);

    /**
     * 查询任务列表
     * @param jobDispatch
     * @return
     */
    List<JobDispatch> selectJobDispathList(JobDispatch jobDispatch);

    /**
     * 根据id查询
     * @param id
     * @return
     */
    JobDispatch selectJobDispatchById(Long id);
}
